﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Xml;

namespace EAISimulatedWebService
{
    /// <summary>
    /// Summary description for AURAService
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class AURAService : System.Web.Services.WebService
    {
        [WebMethod]
        public XmlDocument CheckRule(XmlDocument sourceXml)
        {
            var xmldoc = new XmlDocument();
            xmldoc.LoadXml("<ns0:ESBEnvelope xmlns:ns0=\"http://MetLifeEAI.EAISchema\"><ESBHeader><ESBHdVer>ESBHdVer_0</ESBHdVer><SrvDate>2012-10-14</SrvDate><SrvTime>13:20:00</SrvTime><SenderID>SenderID_0</SenderID><ReceiverID>ReceiverID_0</ReceiverID><SrvOpName>SrvOpName_0</SrvOpName><SrvOpVer>SrvOpVer_0</SrvOpVer><MsgID>MsgID_0</MsgID><CorrID>CorrID_0</CorrID><ESBRspCode>ESBRspCode_0</ESBRspCode><ESBRspDec>ESBRspDec_0</ESBRspDec><ResField1>ResField1_0</ResField1><ResField2>ResField2_0</ResField2><ResField3>ResField3_0</ResField3><ResField4>ResField4_0</ResField4><ResField5>ResField5_0</ResField5></ESBHeader><MsgBody><XML><AURATX><APPNum>APPNum_0</APPNum><Chdrnum>Chdrnum_0</Chdrnum><ApplicationDecision>ApplicationDecision_0</ApplicationDecision><Insureds><Insured><UniqueID>UniqueID_0</UniqueID><Name>Name_0</Name><AcuRiskAmount><RAType>RAType_0</RAType><RAValue>RAValue_0</RAValue></AcuRiskAmount><OverallDecisions><Decision><Product>Product_0</Product><UnderwritingDecision><DecisionCode>DecisionCode_0</DecisionCode><ReasonCode>ReasonCode_0</ReasonCode><ReasonDescription>ReasonDescription_0</ReasonDescription></UnderwritingDecision></Decision><Decision><Product>Product_0</Product><UnderwritingDecision><DecisionCode>DecisionCode_0</DecisionCode><ReasonCode>ReasonCode_0</ReasonCode><ReasonDescription>ReasonDescription_0</ReasonDescription></UnderwritingDecision></Decision><Decision><Product>Product_0</Product><UnderwritingDecision><DecisionCode>DecisionCode_0</DecisionCode><ReasonCode>ReasonCode_0</ReasonCode><ReasonDescription>ReasonDescription_0</ReasonDescription></UnderwritingDecision></Decision></OverallDecisions></Insured></Insureds><ReturnCode>ReturnCode_0</ReturnCode><ReturnDesc>ReturnDesc_0</ReturnDesc></AURATX></XML></MsgBody></ns0:ESBEnvelope>");
            return xmldoc;
        }

        [WebMethod]
        public XmlDocument underwrite(XmlDocument sourceXml)
        {
            var xmldoc = new XmlDocument();
            xmldoc.LoadXml("&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;ProcessMessage xmlns=&quot;http://eai.metlife.com/&quot;&gt;&lt;ESBHeader&gt;&lt;ESBHdVer&gt;20120606_1.0&lt;/ESBHdVer&gt;&lt;SrvDate&gt;2012/10/21&lt;/SrvDate&gt;&lt;SrvTime&gt;10:10:28.10281028&lt;/SrvTime&gt;&lt;SenderID&gt;AURA&lt;/SenderID&gt;&lt;ReceiverID&gt;MTS&lt;/ReceiverID&gt;&lt;SrvOpName&gt;AuraService&lt;/SrvOpName&gt;&lt;SrvOpVer&gt;20120606_1.1&lt;/SrvOpVer&gt;&lt;MsgID&gt;250D75A2-228C-43D3-AF70-91130A9FCBD7&lt;/MsgID&gt;&lt;CorrID&gt;665F45D9-BA06-4AC9-A25D-95861E8B686D&lt;/CorrID&gt;&lt;ESBRspCode&gt;0&lt;/ESBRspCode&gt;&lt;ESBRspDec/&gt;&lt;ResField1/&gt;&lt;ResField2/&gt;&lt;ResField3/&gt;&lt;ResField4/&gt;&lt;ResField5/&gt;&lt;/ESBHeader&gt;&lt;MsgBody&gt;&lt;XML&gt;&lt;AURATX&gt;&lt;APPNum&gt;pri00331213456789&lt;/APPNum&gt;&lt;Chdrnum&gt;12000001&lt;/Chdrnum&gt;&lt;ApplicationDecision&gt;RUW&lt;/ApplicationDecision&gt;&lt;Insureds&gt;&lt;Insured&gt;&lt;UniqueID&gt;CUSTOMID13&lt;/UniqueID&gt;&lt;Name&gt;&#x5F20;&#x4E09;&lt;/Name&gt;&lt;AcuRiskAmount/&gt;&lt;OverallDecisions&gt;&lt;Decision&gt;&lt;Product&gt;AB0010&lt;/Product&gt;&lt;UnderwritingDecision&gt;&lt;DecisionCode&gt;RUW&lt;/DecisionCode&gt;&lt;ReasonCode&gt;A15&lt;/ReasonCode&gt;&lt;ReasonDescription&gt;&#x6295;&#x4FDD;&#x4EBA;&#x804C;&#x4E1A;&#x4EE3;&#x7801;&#x586B;&#x5199;&#x6709;&#x8BEF;&lt;/ReasonDescription&gt;&lt;ReasonCode&gt;A33&lt;/ReasonCode&gt;&lt;ReasonDescription&gt;&#x88AB;&#x4FDD;&#x9669;&#x4EBA;&#x804C;&#x4E1A;&#x4EE3;&#x7801;&#x586B;&#x5199;&#x6709;&#x8BEF;&lt;/ReasonDescription&gt;&lt;ReasonCode&gt;A44&lt;/ReasonCode&gt;&lt;ReasonDescription&gt;&#x8EAB;&#x6545;&#x53D7;&#x76CA;&#x4EBA;&#x53D7;&#x76CA;&#x6BD4;&#x4F8B;&#x672A;&#x586B;&#x5199;&lt;/ReasonDescription&gt;&lt;/UnderwritingDecision&gt;&lt;/Decision&gt;&lt;Decision&gt;&lt;Product&gt;JCI101&lt;/Product&gt;&lt;UnderwritingDecision&gt;&lt;DecisionCode&gt;RUW&lt;/DecisionCode&gt;&lt;ReasonCode&gt;A15&lt;/ReasonCode&gt;&lt;ReasonDescription&gt;&#x6295;&#x4FDD;&#x4EBA;&#x804C;&#x4E1A;&#x4EE3;&#x7801;&#x586B;&#x5199;&#x6709;&#x8BEF;&lt;/ReasonDescription&gt;&lt;ReasonCode&gt;A33&lt;/ReasonCode&gt;&lt;ReasonDescription&gt;&#x88AB;&#x4FDD;&#x9669;&#x4EBA;&#x804C;&#x4E1A;&#x4EE3;&#x7801;&#x586B;&#x5199;&#x6709;&#x8BEF;&lt;/ReasonDescription&gt;&lt;ReasonCode&gt;A44&lt;/ReasonCode&gt;&lt;ReasonDescription&gt;&#x8EAB;&#x6545;&#x53D7;&#x76CA;&#x4EBA;&#x53D7;&#x76CA;&#x6BD4;&#x4F8B;&#x672A;&#x586B;&#x5199;&lt;/ReasonDescription&gt;&lt;/UnderwritingDecision&gt;&lt;/Decision&gt;&lt;Decision&gt;&lt;Product&gt;HOLDERCOV01&lt;/Product&gt;&lt;UnderwritingDecision&gt;&lt;DecisionCode&gt;RUW&lt;/DecisionCode&gt;&lt;ReasonCode&gt;A15&lt;/ReasonCode&gt;&lt;ReasonDescription&gt;&#x6295;&#x4FDD;&#x4EBA;&#x804C;&#x4E1A;&#x4EE3;&#x7801;&#x586B;&#x5199;&#x6709;&#x8BEF;&lt;/ReasonDescription&gt;&lt;ReasonCode&gt;A33&lt;/ReasonCode&gt;&lt;ReasonDescription&gt;&#x88AB;&#x4FDD;&#x9669;&#x4EBA;&#x804C;&#x4E1A;&#x4EE3;&#x7801;&#x586B;&#x5199;&#x6709;&#x8BEF;&lt;/ReasonDescription&gt;&lt;ReasonCode&gt;A44&lt;/ReasonCode&gt;&lt;ReasonDescription&gt;&#x8EAB;&#x6545;&#x53D7;&#x76CA;&#x4EBA;&#x53D7;&#x76CA;&#x6BD4;&#x4F8B;&#x672A;&#x586B;&#x5199;&lt;/ReasonDescription&gt;&lt;/UnderwritingDecision&gt;&lt;/Decision&gt;&lt;Decision&gt;&lt;Product&gt;INSUREDCOV01&lt;/Product&gt;&lt;UnderwritingDecision&gt;&lt;DecisionCode&gt;RUW&lt;/DecisionCode&gt;&lt;ReasonCode&gt;A15&lt;/ReasonCode&gt;&lt;ReasonDescription&gt;&#x6295;&#x4FDD;&#x4EBA;&#x804C;&#x4E1A;&#x4EE3;&#x7801;&#x586B;&#x5199;&#x6709;&#x8BEF;&lt;/ReasonDescription&gt;&lt;ReasonCode&gt;A33&lt;/ReasonCode&gt;&lt;ReasonDescription&gt;&#x88AB;&#x4FDD;&#x9669;&#x4EBA;&#x804C;&#x4E1A;&#x4EE3;&#x7801;&#x586B;&#x5199;&#x6709;&#x8BEF;&lt;/ReasonDescription&gt;&lt;ReasonCode&gt;A44&lt;/ReasonCode&gt;&lt;ReasonDescription&gt;&#x8EAB;&#x6545;&#x53D7;&#x76CA;&#x4EBA;&#x53D7;&#x76CA;&#x6BD4;&#x4F8B;&#x672A;&#x586B;&#x5199;&lt;/ReasonDescription&gt;&lt;/UnderwritingDecision&gt;&lt;/Decision&gt;&lt;/OverallDecisions&gt;&lt;/Insured&gt;&lt;/Insureds&gt;&lt;ReturnCode/&gt;&lt;ReturnDesc/&gt;&lt;/AURATX&gt;&lt;/XML&gt;&lt;/MsgBody&gt;&lt;/ProcessMessage&gt;");
            return xmldoc;
        }
    }
}
